home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / gfx / opal / OpRxWind1.lzh / EmbossBrush.oprx next >
Text File  |  1993-02-03  |  3KB  |  119 lines

  1. /* EmbossBrush.oprx: ARexx script for OpalPaint to Blind Emboss an image
  2.  * with a brush.  Works best with large text, filled circles, and usually
  3.  * rounded shapes.  
  4.  ***** Brian Wind, February 3, 1993 *****
  5.  * Install in your OpalPaint rexx directory (opalpaint:rexx) or wherever 
  6.  * you store your ARexx scripts (rexx:).  Use OpalPaint's ARexx Control Item
  7.  * to set this script to a function key (i.e. type the script name into one
  8.  * of the function key boxes).  Then make a brush in B1, B2, or B3.  Press
  9.  * Amiga key and function key together, and answer a 'helluva' lot of
  10.  * questions (then you can delete those things you don't want in the script.
  11.  * Note: using a small rectangular brush doesn't work quite right in
  12.  * OpalPaint 1.4, if you need to do this, don't use the stencil option
  13.  */
  14.  
  15. address 'OpalPaint_Rexx'
  16.  
  17. options Results
  18.  
  19. SaveSetUp
  20.  
  21. AskBool "Click on OK for Emboss or Cancel for Reverse Emboss"
  22. if RC>5 then exit
  23.         else if result==0 then EMB=-1   /* reverse emboss */
  24.                           else EMB=1    /* emboss */
  25.  
  26.  
  27. AskBool "Click on OK for Blind Emboss or\n Cancel for Emboss using brush colors."
  28. if RC>5 then exit
  29.         else if result==0 then BEMB=0   /* emboss using brush colors */
  30.                           else BEMB=1   /* blind emboss */
  31.  
  32.  
  33. AskBool "Click on Ok if you want a stencil to\nbe made for a cleaner emboss."
  34. if RC>5 then exit
  35.          else if result==0 then UseST=0    /* cancel for no stencil */
  36.                            else UseST=1    /* ok to use stencil */
  37.  
  38.  
  39. AskInt 1 3 "Brush Number (1-3), click OK for default: Brush 1\nClick Cancel to abort."
  40. if RC>4 then exit
  41.         else BN=result
  42.  
  43. /* if okay was pressed and no number was entered, use default brush 1 */
  44. if BN=="" then BN=1
  45.  
  46. /* Set active brush */
  47. ActiveBrush BN
  48.  
  49.  
  50. AskInt 1 50 "Brightness of embossed edges (1-50)\nClick OK for default: 20\nClick Cancel to abort."
  51. if RC>4 then exit
  52.         else BRILLDEPTH=result
  53.  
  54. /* if okay with no number entered, use default of 20 */
  55. if BRILLDEPTH=="" then BRILLDEPTH=20
  56.  
  57.  
  58. AskInt 1 3 "Separation of edges (1-3)\nClick OK for default: 1\nClick Cancel to abort."
  59. if RC>4 then exit
  60.         else SEPE=result
  61.  
  62. /* if okay with no number entered, use default of 1 */
  63. if SEPE=="" then SEPE=1
  64.  
  65. /* modify for emboss type */
  66. SEPE=SEPE*EMB
  67.  
  68.  
  69. AskBool "Click on the image to emboss\nor choose Cancel to abort."
  70. if RC>5 | result==0 then exit
  71.  
  72.  
  73. /* Let user click on image to place brush */
  74. GetPoint
  75. if RC>5 then exit
  76. parse var result PX PY
  77.  
  78.  
  79. /* Next statement for debug purposes */
  80. /*askbool emb' 'usest' 'bn' 'brilldepth' 'sepe' 'PX' 'PY*/
  81.  
  82. /*Busy*/
  83.  
  84. /* set to freehand drawing tool */
  85. FreeHand
  86.  
  87. /* if a stencil was chosen to protect center of emboss */
  88. if useST==1 then
  89.   do
  90.     WorkMode STENCIL
  91.     PutBrush PX PY    
  92.     WorkMode IMAGE
  93.     StenEnable useST
  94.   end
  95.  
  96. WorkMode IMAGE
  97.  
  98. /* Set Brilliance drawing mode and paste brush */
  99. SetDrawMode 8 (BRILLDEPTH * -1)
  100. PutBrush PX+SEPE PY+SEPE
  101.  
  102. SetDrawMode 8 BRILLDEPTH
  103. PutBrush PX-SEPE PY-SEPE
  104.  
  105. /* check for non blind emboss */
  106. if BEMB==0 then
  107.   do
  108.     StenEnable 0
  109.     SetDrawMode 1
  110.     ColorSource MULTICOLOR
  111.     PutBrush PX PY
  112.   end
  113.  
  114. /*NotBusy*/
  115.  
  116. RestoreSetUp
  117.  
  118. exit
  119.